<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
	<title>Podict</title>
	<%= stylesheet_link_tag "rubydictsite", :media => "all" %>
	<%= javascript_include_tag :defaults %>
</head>
<body>
	<div id="top-banner"></div>
	<div id="word-searcher">
	   	<% form_tag words_path, :method=>"get" do  %> 
		<span class="search-label">我想学:</span>  
		<%= text_field_tag :search, params[:search] %> 
		<%= submit_tag "Search" %> 
		<% end %>	
	</div>
	<div id="main">
		<div id="nav">
		   <ul>
			<% if session[:user] == nil%>
			<li><span class="nav-header">您还还没有登录</span></li>
			<li><a href="/admin/login">登录</a><br /></li>
			<li><a href="/users/new">注册</a><br /></li>

			<% else
			  @user = User.find(session[:user])
			%>
			<li><span class="nav-header"><%= @user.username %>的字典</span></li>
			<li><a href="/admin/logout">登出</a></li>
			<li><%= link_to '修改个人资料', edit_user_path(@user) %></li>
			<li><%= link_to "我的收藏", bookmarked_words_path %></li>
			<% end %>
			<li><%= link_to "单词列表", words_path %></li>
			</ul>
		</div>					
		<%= yield :layout %>
	</div>
</body> 
</html> 
